package com.uh.summary.serviceImpl;



import cn.hutool.core.lang.Snowflake;
import cn.hutool.core.util.IdUtil;
import com.uh.calculation.bean.WarnEnterpriseRecord;
import com.uh.calculation.bean.WarnJiSuanBean;
import com.uh.calculation.inter.Warn;
import com.uh.calculation.inter.bathImp.BatchFuwuImp;
import com.uh.calculation.inter.bathImp.BatchMaoyiImp;
import com.uh.calculation.inter.bathImp.Bath_S_MaoyiImp;
import com.uh.calculation.inter.imp.GongyeImp;
import com.uh.calculation.service.CalculationService;
import com.uh.summary.entity.WarnBean;
import com.uh.summary.enums.RuleEnum;
import com.uh.summary.enums.RuleTypeEnum;
import com.uh.summary.enums.TableNameEnum;
import com.uh.summary.mapper.WarnEnterpriseRecordMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.EnumUtils;
import org.joda.time.DateTime;

import java.text.NumberFormat;
import java.util.ArrayList;
import java.util.List;

@Slf4j
public class BatchServerThread implements Runnable {

	private WarnEnterpriseRecordMapper warnEnterpriseRecordMapper;

	private CalculationService calculationService;

	private Warn warn;

	Boolean b;

	RuleTypeEnum ruleType;

	WarnJiSuanBean warnJiSuanBean;



    public BatchServerThread( WarnJiSuanBean warnJiSuanBean) {
    	this.warnJiSuanBean=warnJiSuanBean;

    	this.ruleType=warnJiSuanBean.getRuleType();

    }
	@Override
	public void run() {

		switch (ruleType) {
			case industrial:

				warn = new GongyeImp();
				break;//工业
			case investment:
				warn = new GongyeImp();
				break;//投资
			case trade:
				warn = new BatchMaoyiImp();
				break;//贸易
			case trades:
				warn = new Bath_S_MaoyiImp();
				break;//贸易
			case services:
				warn = new BatchFuwuImp();
				break;//服务
		}
		warn.jisuan(warnJiSuanBean);



	}








}